# pywebdev : PYTHON WEB DEVELOPER Ubuntu Meta Package
#
#  created: JCM 01-01-2008
# modified: JCM 05-06-2008
# modified: JCM 10-18-2008
# modified: JCM 01-18-2009 automatically create the archive file
# modified: JCM 04-19-2009 for Ubuntu v9.04                         
# modified: JCM 10-31-2009 for Ubuntu v9.10                         
# 
# $LastChangedDate: 2009-10-31 22:52:48 +0000 (Sat, 31 Oct 2009) $ $LastChangedRevision: 27 $
#
# Copyright (C) 2008-9  James C. McDonald
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License 
# Version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the 
#
# Free Software Foundation, Inc.
# 59 Temple Place - Suite 330
# Boston, MA  02111-1307, USA.
#

UBUNTU_VERSION=9.10
PYWEBDEV_VERSION=$(UBUNTU_VERSION).1
PYWEBDEV_NAME_PREFIX=pywebdev-ubuntu-
PYWEBDEV_BUILD_DIR =./build
PYWEBDEV_ARCHIVE_DIR =./build/$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION)
PYWEBDEV_TAR_ARCHIVE_DIR =$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION)

# ##############################################################################

all: $(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).deb $(PYWEBDEV_BUILD_DIR)/$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).tgz

$(PYWEBDEV_BUILD_DIR)/$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).tgz: $(PYWEBDEV_BUILD_DIR)/$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).deb
	mkdir -p $(PYWEBDEV_ARCHIVE_DIR)
	cp $(PYWEBDEV_BUILD_DIR)/$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).deb $(PYWEBDEV_ARCHIVE_DIR)
	cp README.txt $(PYWEBDEV_ARCHIVE_DIR)
	tar cvfz $(PYWEBDEV_BUILD_DIR)/$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).tgz -C $(PYWEBDEV_BUILD_DIR)/ $(PYWEBDEV_TAR_ARCHIVE_DIR)
	ls -l $(PYWEBDEV_BUILD_DIR)/$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).tgz 

$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).deb: ./files/DEBIAN/control 
	dpkg --build files $(PYWEBDEV_BUILD_DIR)/$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).deb
	ls -l ./build/*.deb
clean : 
	rm -f $(PYWEBDEV_BUILD_DIR)/$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).deb
	rm -f $(PYWEBDEV_BUILD_DIR)/$(PYWEBDEV_NAME_PREFIX)$(PYWEBDEV_VERSION).tgz        
	rm -f $(PYWEBDEV_ARCHIVE_DIR)/*.deb
	rm -f $(PYWEBDEV_ARCHIVE_DIR)/*.txt
	rmdir $(PYWEBDEV_ARCHIVE_DIR)
